﻿using System;
using System.Windows;
using EzDesk.DesktopClient.UtilityView.ViewModel;
using EzDesk.Generic;
using EzDesk.Generic.WPF;
using EzDesk.DesktopClient.ViewBase;

namespace EzDesk.DesktopClient.OptionsModule
{
    /// <summary>
    /// Interaction logic for FunctionPageView.xaml
    /// </summary>
    public partial class OptionsView : WindowBaseNotMainView, IOptionsView
    {

        public OptionsView()
        {
            InitializeComponent();
            this.Dispatcher.BeginInvoke(new Action(this.Init));
        }

        private void Init()
        {
            this.ToBeTop().ToBeside(Application.Current.MainWindow);
            this.TopContent.Content = new TopPanelViewModel().View;
        }

        protected void btnOK_Click(object sender, RoutedEventArgs e)
        {
            this.OnSave.ExecuteMethod(sender, e);
            this.Close();
        }
        
        public event EventHandler OnSave;
    }
}
